<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>评论动态</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#165DFF',
                        secondary: '#722ED1',
                        success: '#00B42A',
                        danger: '#F53F3F',
                        warning: '#FF7D00',
                        info: '#86909C',
                        light: '#F2F3F5',
                        dark: '#1D2129',
                    },
                    fontFamily: {
                        inter: ['Inter', 'sans-serif'],
                    },
                }
            }
        }
    </script>
</head>
<body class="font-inter bg-gray-50 min-h-screen">
    <!-- 顶部导航 -->
    <header class="bg-white shadow-sm sticky top-0 z-10">
        <div class="container mx-auto px-4 py-3 flex items-center justify-between">
            <div class="flex items-center gap-2">
                <i class="fa fa-comments text-primary text-xl"></i>
                <h1 class="text-lg font-bold">SocialApp</h1>
            </div>
            
            <a href="javascript:history.back()" class="text-info hover:text-primary transition-colors">
                <i class="fa fa-arrow-left"></i>
            </a>
        </div>
    </header>

    <!-- 主要内容 -->
    <main class="container mx-auto px-4 py-6 max-w-md">
        <div class="bg-white rounded-xl shadow-sm p-5 mb-6">
            <h2 class="text-xl font-bold mb-4">评论动态</h2>
            
            <form action="commentLog" method="post" class="space-y-4">
                <input type="hidden" id="logId" name="logId" value="${log.id}">
                
                <div>
                    <label for="content" class="block text-sm font-medium text-gray-700 mb-1">评论内容</label>
                    <textarea id="content" name="content" rows="4" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-primary transition-colors" required></textarea>
                </div>
                
                <div class="flex items-center">
                    <input type="checkbox" id="isLike" name="isLike" class="w-4 h-4 text-primary border-gray-300 rounded focus:ring-primary">
                    <label for="isLike" class="ml-2 text-sm text-gray-700">同时点赞</label>
                </div>
                
                <button type="submit" class="w-full bg-primary hover:bg-primary/90 text-white py-2 px-4 rounded-lg font-medium transition-colors flex items-center justify-center gap-2">
                    <i class="fa fa-paper-plane"></i>
                    发布评论
                </button>
            </form>
        </div>
        
        <!-- 动态预览 -->
        <div class="bg-white rounded-xl shadow-sm p-5">
            <div class="flex items-center gap-3">
                <img src="${log.user.avatar}" alt="${log.user.nickname}" class="w-10 h-10 rounded-full object-cover">
                <div>
                    <h3 class="font-medium">${log.user.nickname}</h3>
                    <p class="text-xs text-info">${log.publishTime}</p>
                </div>
            </div>
            
            <div class="mt-3">
                <p>${log.content}</p>
                
                <c:if test="${not empty log.attachment}">
                    <div class="mt-2 rounded-lg overflow-hidden">
                        <img src="${log.attachment}" alt="Post Image" class="w-full h-auto object-cover rounded-lg">
                    </div>
                </c:if>
            </div>
        </div>
    </main>

    <!-- 底部导航（移动端） -->
    <nav class="md:hidden fixed bottom-0 left-0 right-0 bg-white shadow-[0_-2px_10px_rgba(0,0,0,0.05)] py-2 z-10">
        <div class="grid grid-cols-4 text-center">
            <a href="#" class="text-info hover:text-primary transition-colors">
                <i class="fa fa-home"></i>
                <p class="text-xs mt-1">社交圈</p>
            </a>
            <a href="#" class="text-info hover:text-primary transition-colors">
                <i class="fa fa-user"></i>
                <p class="text-xs mt-1">我的</p>
            </a>
            <a href="#" class="text-primary">
                <i class="fa fa-bell"></i>
                <p class="text-xs mt-1">通知</p>
            </a>
            <a href="#" class="text-info hover:text-primary transition-colors">
                <i class="fa fa-cog"></i>
                <p class="text-xs mt-1">设置</p>
            </a>
        </div>
    </nav>
</body>
</html>